
export default {
	data: function () {
		return {
			dev:process.env.NODE_ENV === 'development' ? true : false
		}
	},
	methods:{
		//消息,success,warning,error
		message( message, type='') {
			this.$message({ message: message, type: type });
		},

		msg(...params){
			this.message(params)
		},

		//确认框
		confirm( title = '确认要进行这个操作吗' , callback,) {
			this.$confirm(title, '提示', {
				confirmButtonText: '确定',
				cancelButtonText : '取消',
				type             : 'warning',
			}).then(() => {
				callback()
			}).catch(() => {

			});
		},


		//右上角的通知提示":success, warning, info, error
		notify(message='',type='info',duration=2000){
			this.$notify({ title: '提示', message: message ,duration:duration,type:type })
		},

		/**
		 * @desc: element ui 全屏加载
		 * 使用方法:
		 * 显示：this.loading = this.loadingFull()
		 * 关闭：this.loading.close()
		 */
		loadingFull () {
			return this.$loading({
				lock      : true,
				text      : '加载中',
				spinner   : 'el-icon-loading',
				background: 'rgba(0, 0, 0, 0.7)',
			});
		},
		
		jump(url){
			this.$router.push(url)
		},
		
		push(url){
			this.$router.push(url)
		},
	}
}
